package helloworld.admin.assembler.teacher;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;

import helloworld.admin.bean.TeacherAdminBean;
import helloworld.admin.form.teacher.TeacherForm;

/** 
 * @author TUYEN-DM
 *         <p>
 *         2009/05/13
 *         </p>
 *         <p>
 *         TeacherFormAssembler is the object to process copyProperties.
 *         </p>
 */
public class TeacherFormAssembler
{	
	private TeacherFormAssembler() { }

	public static final TeacherForm createTeacherForm(TeacherAdminBean teacherDetail)
	{
		TeacherForm form = new TeacherForm();
		try
		{
			BeanUtils.copyProperties(form, teacherDetail);			
		}
		catch (InvocationTargetException ite)
		{
			ite.printStackTrace();	//do nothing for now
		}
		catch (IllegalAccessException iae)
		{
			iae.printStackTrace();	//do nothing for now
		}
		return form;		
	}
}